From 4d2c0a843a1278c159e0a880c5c180c180a4b2fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20=C3=85dahl?= Date: Mon, 12 Sep 2016 15:00:21 +0800 Subject: [PATCH] wayland: Don't pass non-changing state when calculating popup rects https://bugzilla.gnome.org/show_bug.cgi?id=771117 --- gdk/wayland/gdkwindow-wayland.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 929ee0c238..d8a6355e3f 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -1626,20 +1626,25 @@ get_real_parent_and_translate (GdkWindow *child, static void calculate_popup_rect (GdkWindow *window, - GdkRectangle anchor_rect, GdkGravity rect_anchor, GdkGravity window_anchor, - int rect_anchor_dx, - int rect_anchor_dy, GdkRectangle *out_rect) { + GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); GdkRectangle geometry; + GdkRectangle anchor_rect; int x = 0, y = 0; gdk_wayland_window_get_window_geometry (window, &geometry); - anchor_rect.x += rect_anchor_dx; - anchor_rect.y += rect_anchor_dy; + anchor_rect = (GdkRectangle) { + .x = (impl->pending_move_to_rect.rect.x + + impl->pending_move_to_rect.rect_anchor_dx), + .y = (impl->pending_move_to_rect.rect.y + + impl->pending_move_to_rect.rect_anchor_dy), + .width = impl->pending_move_to_rect.rect.width, + .height = impl->pending_move_to_rect.rect.height + }; switch (rect_anchor) { @@ -1808,11 +1813,8 @@ calculate_moved_to_rect_result (GdkWindow *window, y += impl->transient_for->shadow_top; calculate_popup_rect (window, - impl->pending_move_to_rect.rect, impl->pending_move_to_rect.rect_anchor, impl->pending_move_to_rect.window_anchor, - impl->pending_move_to_rect.rect_anchor_dx, - impl->pending_move_to_rect.rect_anchor_dy, &best_rect); gdk_wayland_window_get_window_geometry (window, &geometry); @@ -1837,11 +1839,8 @@ calculate_moved_to_rect_result (GdkWindow *window, flipped_window_anchor = flip_anchor_horizontally (impl->pending_move_to_rect.window_anchor), calculate_popup_rect (window, - impl->pending_move_to_rect.rect, flipped_rect_anchor, flipped_window_anchor, - impl->pending_move_to_rect.rect_anchor_dx, - impl->pending_move_to_rect.rect_anchor_dy, &flipped_x_rect); if (flipped_x_rect.x == x) @@ -1859,11 +1858,8 @@ calculate_moved_to_rect_result (GdkWindow *window, flipped_window_anchor = flip_anchor_vertically (impl->pending_move_to_rect.window_anchor), calculate_popup_rect (window, - impl->pending_move_to_rect.rect, flipped_rect_anchor, flipped_window_anchor, - impl->pending_move_to_rect.rect_anchor_dx, - impl->pending_move_to_rect.rect_anchor_dy, &flipped_y_rect); if (flipped_y_rect.y == y) -- 2.30.2